package com.ohos.connect.devicecloud.iot.modular.device.api;

import com.ohos.connect.devicecloud.iot.api.DeviceApi;
import com.ohos.connect.devicecloud.iot.model.dto.*;
import com.ohos.connect.devicecloud.iot.model.dto.deviceactive.DeviceActiveDTO;
import com.ohos.connect.devicecloud.iot.model.dto.deviceinfosync.DeviceInfoSyncDTO;
import com.ohos.connect.devicecloud.iot.model.vo.*;
import com.ohos.connect.devicecloud.iot.model.vo.deviceactive.DeviceActiveVO;
import com.ohos.connect.devicecloud.iot.modular.device.service.DeviceService;
import org.eclipse.paho.mqttv5.common.MqttException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("deviceApi")
public class DeviceApiImpl implements DeviceApi {

    @Resource
    private DeviceService deviceService;

    @Override
    public DevicePskVO exchangeDeviceSn(DevicePskDTO devicePskDTO) {
        return deviceService.exchangeDeviceSn(devicePskDTO);
    }

    @Override
    public DeviceActiveVO activeDevice(DeviceActiveDTO deviceActiveDTO) {
        return deviceService.activeDevice(deviceActiveDTO);
    }

    @Override
    public DeviceLoginVO loginDevice(DeviceLoginDTO deviceLoginDTO) {
        return deviceService.loginDevice(deviceLoginDTO);
    }

    @Override
    public DeviceInfoSyncVO syncDeviceInfo(List<DeviceInfoSyncDTO> deviceInfoSyncDTOList) {
        return deviceService.syncDeviceInfo(deviceInfoSyncDTOList);
    }

    @Override
    public DeviceDataVO deviceDataUpload(List<DeviceDataInfoDTO> deviceDataInfoDTOList) {
        return deviceService.deviceDataUpload(deviceDataInfoDTOList);
    }

    @Override
    public DeviceRevokeVO deviceRevoke(DeviceRevokeDTO deviceRevokeDTO) {
        return deviceService.deviceRevoke(deviceRevokeDTO);
    }

    @Override
    public DeviceAuthCodeVO deviceAuthCode(DeviceAuthCodeDTO deviceAuthCodeDTO) {
        return deviceService.deviceAuthCode(deviceAuthCodeDTO);
    }

    @Override
    public DeviceHeartBeatVO deviceHeartBeat(DeviceHeartBeatDTO deviceHeartBeatDTO) {
        return deviceService.deviceHeartBeat(deviceHeartBeatDTO);
    }

    @Override
    public List<DeviceInfoVO> getDeviceInfoList(List<String> deviceIdList) {
        return deviceService.getDeviceInfoList(deviceIdList);
    }

    @Override
    public DeviceInfoVO getDeviceInfoById(String deviceId) {
        return deviceService.getDeviceInfoById(deviceId);
    }


}
